def ReadText(number):
	'''写入文本信息'''
	try:
		with open('numbers.txt','w') as file_obj:
			file_obj.write(number)
				
	except FileNotFoundError:
		pass
		
for i in range(1,9999): #写入
	ReadText(str(i))
	
try:	#读取
	with open('numbers.txt') as file_obj:
		massaes = file_obj.read()
		print(massaes)
	
except FileNotFoundError:
	pass
	
filename = 'numbers.txt'
with open('numbers.txt') as file_obj:
	massaes = file_obj.read()

words = massaes
num = len(words)
print(num)
